// Функуии для работы блокнота

function addToBlocknote(id_offer, id_category)
{
	$.post(
		'/ajax/addblocknote', 
		{ id_offer: id_offer, id_category: id_category },
		function(data)
		{
	   		document.getElementById('blocknote_link').style.display = 'inline';
	   		document.getElementById('no_blocknote_'+id_offer).style.display = 'none';
	   		var count_span = document.getElementById('blocknote_count');
	   		count_span.innerHTML = data;
	   		
	   		var display_div = document.getElementById('fixme');
	   		display_div.style.display = 'block';
	   		var count_in_display_div = document.getElementById('fixme_count');
	   		count_in_display_div.innerHTML = data;
//	   		var target_div = document.getElementById('blocknote');
//	   		target_div.style.display = 'block';
//	   		target_div.innerHTML = data;
		}
	);
}

function removeFromBlocknote(id_offer, id_category)
{
	$.post(
		'/ajax/removeblocknote', 
		{ id_offer: id_offer, id_category: id_category },
		function(data)
		{
	   		var container = document.getElementById('element_container');
	   		var element = document.getElementById('element_'+id_offer);
	   		container.removeChild(element);
	   		var count_span = document.getElementById('blocknote_count');
	   		count_span.innerHTML = data;
	   		
	   		var display_div = document.getElementById('fixme');
	   		if (data == 0) display_div.style.display = 'none';
	   		else
	   		{
		   		var count_in_display_div = document.getElementById('fixme_count');
		   		count_in_display_div.innerHTML = data;
	   		}
//	   		target_div = document.getElementById('blocknote');
//	   		target_div.innerHTML = data;
		}
	);
}